
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xbmcgui

'''
def getCallRequest(caller) :
	dialog = xbmcgui.Dialog()
	ret = dialog.yesno('Skype', '(%s) is calling ...' % (caller) , line2= "Do you like to receive?")
	return ret
'''

class Notifier :
	def __init__(self) :
		self.server = SimpleXMLRPCServer(('localhost', 9991))
		pass
	
	def start(self):
		self.server.register_function(self.getCallRequest, "sendCallRequest")
		
		print 'server start @ localhost ', 9991
		self.server.serve_forever()
	
	def getCallRequest(self, caller) :
		dialog = xbmcgui.Dialog()
		ret = dialog.yesno('Skype', '%s is calling ...' % (caller) ,  "Do you like to receive?", '')
		return ret

if __name__ == '__main__' :
	n = Notifier()
	n.start()
